import axios from 'services/axiosConfig.js'
import { NotificationApi } from 'services/apiConfig.js'

class NotificationService {
  updateNotification (notification) {
    return axios({
      method: NotificationApi.updateNotification.method,
      url: NotificationApi.updateNotification.url + notification.id,
      data: notification
    })
  }
  addNotification(notification) {
    return axios({
      method: NotificationApi.addNotification.method,
      url: NotificationApi.addNotification.url,
      data: notification
    })
  }
  getNotification(userId) {
    return axios({
      method: NotificationApi.getNotification.method,
      url: NotificationApi.getNotification.url + '?Notification.userid=' + userId
    })
  }
  getAccessableNotification(userId) {
    return axios({
      method: NotificationApi.getNotification.method,
      url: NotificationApi.getNotification.url + '?Notification.userid=' + userId + '&Notification.accessiblity=1'
    })
  }
}

export default new NotificationService()
